package com.smugglersend.app;

import android.app.Application;
import android.graphics.Typeface;
import android.widget.TextView;

/**
 * Created by Carlos on 4/21/2014.
 */
public class CustomFontsLoader extends Application {

    private Typeface boldFont;
    private Typeface normalFont;

    // -- Fonts -- //
    public void setTypeface(TextView textView) {
        if(textView != null) {
            if(textView.getTypeface() != null && textView.getTypeface().isBold()) {
                textView.setTypeface(getBoldFont());
            } else {
                textView.setTypeface(getNormalFont());
            }
        }
    }

    private Typeface getNormalFont() {
        normalFont = Typeface.createFromAsset(getAssets(),"FONT_NORMAL.ttf");

        return this.normalFont;
    }

    private Typeface getBoldFont() {
            boldFont = Typeface.createFromAsset(getAssets(), "FONT_BOLD_LARGE.ttf");

        return this.boldFont;
    }
}